<?php
if(!defined('ADMIN')){
	exit('Access Denied');
}



$page = !($_POST['pageNum'])?'1':intval($_POST['pageNum']);
$pagesize= !($_POST['numPerPage'])?'20':intval($_POST['numPerPage']);


if(empty($pagesize)){
    $pagesize=20;
}
$frmnum=($page-1)*$pagesize;
$orderField=trim($_POST["orderField"]);
$orderDirection=trim($_POST["orderDirection"]);
if(empty($orderField)){
    $orderField="id";
}
if(empty($orderDirection)){
    $orderDirection="desc";
}
if($orderField<>""){
    $order=" order by $orderField ".$orderDirection;
}else{
    $order=" order by id desc";
}
$q=trim($_POST['q']);
$where="";
if(!empty($q)){
    $where.=" and j.title like '%$q%'";
}


$total=$ezhand->count("hr_interview v,jobs j,hr h,school s,company c"," v.uid=h.tid and v.jobsid=j.tid and v.schoolid=s.tid and v.companyid=c.tid ".$where);
$jobslist=$ezhand->select_all("hr_interview v,jobs j,hr h,school s,company c",'v.id,v.fromdate,v.status,v.uid,v.jobsid,v.companyid,h.title as realname,h.mainprofession,j.title as jobsname,j.dept,s.title as schoolname,c.title as companyname'," v.uid=h.tid and v.jobsid=j.tid and v.schoolid=s.tid  and v.companyid=c.tid  ".$where." order by v.addtime desc limit ".$frmnum.",".$pagesize);
    

?>